var path = require('path');
var webpack = require('webpack');
var srcDir = path.join(process.cwd(), 'client')
var buildDir = path.join(process.cwd(), 'build')
var AssetsPlugin = require('assets-webpack-plugin');
var srcDir = path.join(process.cwd(), 'src'); // process.cwd()：返回运行当前脚本的工作目录的路径
var path = require("path");

module.exports = {
	entry: {
		vendor: ['react', 'react-dom', 'react-router', 'jquery'],
	},
	output: {
		publicPath: '/',
		path: path.join(buildDir, 'static'),
		filename: 'dll/[name].[hash:5].dll.js',
		library: '[name]_library'
	},
	plugins: [
		new webpack.DefinePlugin({
			'process.env.NODE_ENV': '"production"'
		}),
		new webpack.DllPlugin({
			context: __dirname,
			path: path.join(buildDir, 'static/dll/[name]-manifest.json'),
			name: '[name]_library'
		}),
		new AssetsPlugin({
			filename: 'build/bundle-config.json',
			path: path.resolve(__dirname)
		}),
		// new webpack.optimize.UglifyJsPlugin({
		// 	output: {
		// 		comments: false,
		// 	},
		// 	compress: {
		// 		warnings: false
		// 	}
		// })
	]
};